<!DOCTYPE html>
<html>

	<head>
		<meta charset="utf-8">
		<title></title>
		<!--<script src="/javascripts/jq.js"></script>-->
		<script type="text/javascript" src="javascripts/jq.js"></script>
	</head>

	<body>

		<h1>status:<span id="status"></span></h1>

		<script>
			function checkSPSO() {
				$.ajax({
					url: "/index1",
					//method: "post",
					data: "data=" + window.counter || "-1",
					success: function(data) {
						data = data.substring(4);
						$("#status").html(data);
						window.counter = data;
						if (data.length>0&&data.indexOf("error")!=0) {
							setTimeout(checkSPSO, 1000);
						}
					}
				});
			}
			window.counter = -1;
			checkSPSO();
		</script>

	</body>

</html>